package cn.iocoder.yudao.adminserver.modules.system.convert.dict;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.adminserver.modules.system.controller.dict.vo.type.*;
import cn.iocoder.yudao.adminserver.modules.system.dal.dataobject.dict.SysDictTypeDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface SysDictTypeConvert {

    SysDictTypeConvert INSTANCE = Mappers.getMapper(SysDictTypeConvert.class);

    PageResult<SysDictTypeRespVO> convertPage(PageResult<SysDictTypeDO> bean);

    //SysDictTypeRespVO convert(SysDictTypeDO bean);

    default SysDictTypeRespVO convert(SysDictTypeDO bean) {
        if ( bean == null ) {
            return null;
        }
        SysDictTypeRespVO sysDictTypeRespVO = new SysDictTypeRespVO();
        sysDictTypeRespVO.setName(bean.getName());
        sysDictTypeRespVO.setStatus(bean.getStatus());
        sysDictTypeRespVO.setRemark(bean.getRemark());
        sysDictTypeRespVO.setId(bean.getId());
        sysDictTypeRespVO.setType(bean.getType());
        sysDictTypeRespVO.setCreateTime(bean.getCreateTime());
        sysDictTypeRespVO.setShowMode(bean.getShowMode());
        return sysDictTypeRespVO;
    }

    default SysDictTypeDO convert(SysDictTypeCreateReqVO bean){
        if ( bean == null ) {
            return null;
        }
        SysDictTypeDO obj = new SysDictTypeDO();
        obj.setName(bean.getName());
        obj.setStatus(bean.getStatus());
        obj.setRemark(bean.getRemark());
        obj.setType(bean.getType());
        obj.setShowMode(bean.getShowMode());
        return obj;
    }

    SysDictTypeDO convert(SysDictTypeUpdateReqVO bean);

    List<SysDictTypeSimpleRespVO> convertList(List<SysDictTypeDO> list);

    List<SysDictTypeExcelVO> convertList02(List<SysDictTypeDO> list);

}
